﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BHYT.Server.Bll
{
    public class SMTPClientBll
    {
        BHYTEntities entities;
        
        public SMTPClientBll()
        {
            entities = new BHYTEntities();
        }

        public SMTPClient RetrieveSMTPClientByEmail(string email)
        {
            string domain = email.Substring(email.IndexOf('@') + 1);
            if (string.IsNullOrEmpty(domain))
                return null;
            return entities.SMTPClients.FirstOrDefault(u => u.Domain == domain);
        }
    }
}
